package com.kotasoft.iip.integration.predicates;

import org.apache.camel.Exchange;
import org.apache.camel.Predicate;

public class ClassPredicate implements Predicate {

	public final Class<?> clazz;

	public ClassPredicate(Class<?> clazz) {
		this.clazz = clazz;
	}

	public boolean matches(Exchange exchange) {
		Object object = exchange.getIn().getBody();
		return clazz.isAssignableFrom(object.getClass());
	}

}
